<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <h:form id="form" acceptcharset="utf-8">
                <p:growl id="msg" life="5000"/>
                <center>
                    <table id="table" style="width:500px;">
                        <tbody>
                            <ui:repeat value="#{managerEditQuestionnaireResponse.categorys}" var="category">

                                <tr style="font-weight: bold; color:#3DA2DC; font-size: 16px; text-align: center; font-family: sans-serif">
                                    <td>
                                        <h:outputLabel value="#{category.name}" />  
                                    </td>

                                </tr>
                                <ui:repeat id="i" value="#{category.issueses}" var="issues">
                                    <tbody style="color: #000000; font-size: 14px;">

                                        <tr style="font-weight: bold; text-align: center; font-family: sans-serif">
                                            <td>
                                                <h:outputLabel value="#{issues.title}" />  
                                            </td>
                                        </tr>                                   
                                    </tbody>

                                    <tbody  style="color: #000000; font-size: 12px;">

                                        <tr style="text-align: center; font-family: sans-serif">
                                            <td>
                                                <center>
                                                    <p:selectManyCheckbox value="#{managerEditQuestionnaireResponse.lstOptions}" converter="optionsConverter" layout="pageDirection" rendered="#{issues.typeIssues eq 'CHOICEMULTIPLE'}">  
                                                        <f:selectItems value="#{issues.options}" var="op" itemLabel="#{op.title}"
                                                                       itemValue="#{op}"
                                                                       />  
                                                    </p:selectManyCheckbox> 

                                                    <p:selectOneRadio id="selectOne" value="#{managerEditQuestionnaireResponse.options}" required="true" converter="optionsConverter" layout="pageDirection" rendered="#{issues.typeIssues eq 'CHOOSEONE'}">  
                                                        <f:selectItems id="one" value="#{issues.options}" var="op" itemLabel="#{op.title}"
                                                                       itemValue="#{op}" 
                                                                       />
                                                        <p:ajax  event="change" /> 
                                                    </p:selectOneRadio> 

                                                    <p:inputText rendered="#{issues.typeIssues eq 'OPEN'}" size="40"/>

                                                </center>
                                                <br/>
                                            </td>

                                        </tr>                                   
                                    </tbody>
                                </ui:repeat>
                            </ui:repeat>
                        </tbody>
                    </table>

                </center>

                <br/>
                <center>
                    <!--<p:commandButton value="Cancelar" actionListener="{managerCreateQuestionnaire.redirect('viewQuestionnaire.xhtml')}" update="@form" immediate="true" style="font-size: 12px; font-family: sans-serif" />-->
                    <p:commandButton value="Responder Questionário" actionListener="#{managerEditQuestionnaireResponse.update()}" process="@this" style="font-size: 12px; font-family: sans-serif" />

                </center>
            </h:form>
        </ui:define>
    </ui:composition>
</html>



